package com.lj.demo.springbootshirojwt.entity;

import com.google.common.base.Objects;

import java.io.Serializable;
import java.util.List;

/**
 * Title: 角色实体类
 * Description:
 * Date: 2019年06月24日 14:57
 *
 * @author lvjie@hiynn.com
 * @version 1.0
 * Significant Modify：
 * Date                  Author                 Content
 * =================================================================
 * 2019年06月24日         lvjie@hiynn.com         创建文件,实现基本功能
 * =================================================================
 */
public class Role implements Serializable {

    private static final long serialVersionUID = 1335513324003042017L;

    /**
     * 角色ID
     */
    private String id;

    /**
     * 角色名称
     */
    private String name;

    /**
     * 拥有权限的集合
     */
    private List<Authorize> authorizes;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Authorize> getAuthorizes() {
        return authorizes;
    }

    public void setAuthorizes(List<Authorize> authorizes) {
        this.authorizes = authorizes;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Role role = (Role) o;
        return Objects.equal(id, role.id) &&
                Objects.equal(name, role.name) &&
                Objects.equal(authorizes, role.authorizes);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id, name, authorizes);
    }

    @Override
    public String toString() {
        return "Role{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", authorizes=" + authorizes +
                '}';
    }
}
